package org.kl.bf.report.exporter;

import java.io.OutputStream;

import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.export.JRPdfExporter;
import net.sf.jasperreports.export.SimpleExporterInput;
import net.sf.jasperreports.export.SimpleOutputStreamExporterOutput;

/**
 * @date 2014年6月9日
 * @thanksTo OneThin
 * @sourcefrom http://my.oschina.net/onethin/blog/14360
 */
public class ReportPdfExporter extends AbstractReportFileExporter {
	public void export(JasperPrint jasperPrint, OutputStream os) throws JRException {
		JRPdfExporter exporter = new JRPdfExporter();
		exporter.setExporterInput(new SimpleExporterInput(jasperPrint));
		exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(os));
		exporter.exportReport();
	}
}
